home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / maximus / mul100.zip / RDUSR.SCR < prev    next >
Text File  |  1993-02-01  |  2KB  |  45 lines

  1.  
  2. // RDUSR.SCR  --  Read and Display a Maximus User file  --  Version 1.00
  3. //
  4. // Script program for MUL - the Maximus User Language
  5. // MUL is (C) Copyright 1990-93 by CodeLand Australia
  6. //
  7. // USAGE:       MUL -pRdUsr                     or
  8. //              MUL -pRdUsr <Priv>
  9.  
  10. // RdUsr is based on the utility of the same name, released into the SDSMAX
  11. // file distribution area. Sorry I'm not aware of the Author's name, though
  12. // he lists his wife's BBS as Prism BBS, Fidonet 1:272/38. In his words..
  13. // This is a very simple little utility to read users from a Max. user.bbs
  14. // file and output their priv. levels, names, addresses and phone numbers
  15. // to stdout. It takes one optional parameter - the first letter (or more)
  16. // of the priv. level you want to output. If there are no command line
  17. // parameters then it outputs all users.
  18.  
  19. char *ufile = "USER.BBS";                   // Path & name of Maximus user file
  20. //char *ufile = "C:\\BBS\\USER.BBS";        // Path & name of Maximus user file
  21.  
  22. main (int argc, char *arg1)                 // Main program
  23. {
  24.     int rec=1;                              // Current record number
  25.     char pletter, priv[10];                 // Work variables
  26.  
  27.     if (!BaseOpenR (ufile)) {
  28.         printf ("ERROR opening user file %s\n",ufile);
  29.         exit ();
  30.     }
  31.  
  32.     if (argc) pletter=toupper (arg1[0]);
  33.  
  34.     while (BaseRead (rec++)) {
  35.         strcpy (priv,BasePrivStr (USRpriv));
  36.         if(!argc || pletter == priv[0])
  37.             printf ("%c %-20s %-24s %s\n",priv[0],USRname,USRcity,USRphone);
  38.     }
  39.  
  40.     BaseClose ();                           // Close the user base
  41. }
  42.  
  43. // End of script
  44.  
  45.